<?php echo $this->Form->create('Task',array('action'=>'search'));?>
<div id="search">
	<?php echo $html->link(__('Add New Task',true), array('controller'=> 'backlogs', 'action'=>'add'), array('class'=>'button')); ?>
	<div class="element">Search By</div>
	<div class="element"><?php 
		echo $form->input('Task.taskKeyword',array('div'=>false,'label'=>false,'style'=>'width:200px;margin-top:6px'));
	?></div>
	<div class="element"><input type="submit" value=" Go " class="submit" /></div>
</div>

<div class="list_header">
		<?php
			echo $this->Paginator->counter(array(
				'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
			));
		?>
		<div class="pages">
			<?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>|
			<?php echo $this->Paginator->numbers();?>|
			<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?></div>
		</div>
		<div id="container" class="clearfix">
		<table border="0" cellpadding="5" cellspacing="0" width="100%">
			<tr class="title">
				<td><?php echo $this->Paginator->sort('Id','Task.id');?></td>
				<td><?php echo $this->Paginator->sort('Task Name','Task.taskName');?></td>
				<td><?php echo $this->Paginator->sort('Status','Task.status_id');?></td>
				<td>Owner</td>
				<td>Responsible</td>
				<td colspan="8"><span><?php __('Actions');?></span></td>
			</tr>
			<?php
	
	foreach ($tasks as $task):
	?>
	<tr>
		<td><?php echo $task['Task']['id']; ?>&nbsp;</td>
		<td><?php echo $task['Task']['taskName']; ?>&nbsp;</td>
		<td><?php echo $task['Task']['status_id']; ?>&nbsp;</td>
		<td><?php echo $task['CreatedUser']['firstName']; echo $task['CreatedUser']['lastName'];?>&nbsp;</td>
		<td><?php echo $task['ResUser']['firstName'];?>&nbsp;<?php echo $task['ResUser']['lastName'];?></td>
		<td class="actions">
			<?php echo $this->Html->link(__('Add Item', true), array('controller' => 'tasks', 'action' => 'addItem', 'id:'.$task['Task']['id']));  ?>
			<?php echo $this->Html->link(__('Edit', true), array()); ?>
			<?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $task['Task']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $task['Task']['taskName'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
		</table>
		</div>